﻿using System;
using System.IO;
using System.Xml.Serialization;
using WindowsGame.Data;
using WindowsGame.Enums;

namespace XnaConsoleApplication
{
	class Program
	{
		static void Main()
		{
			SnakeData snake = new SnakeData
			{
				StartPosX = 10,
				StartPosY = 10,
				Direction = Direction.Left,
				TailLength = 20,
				TimeOnTile = 50,
				TileToMove = 10
			};

			String fileName = "SnakeData.xml";
			SnakeData[] snakeData = new[] { snake };

			FileStream saveFile = File.Open(fileName, FileMode.Create);
			XmlSerializer xmlSerializer = new XmlSerializer(typeof(SnakeData[]));

			xmlSerializer.Serialize(saveFile, snakeData);
			saveFile.Close();
		}
	}
}